package cn.zhangmh.easymvp.books;

import android.content.Context;

import cn.zhangmh.easymvp.RetrofitHelper;
import cn.zhangmh.easymvp.books.entity.Annotation;
import cn.zhangmh.easymvp.books.entity.Annotations;
import cn.zhangmh.easymvp.books.entity.BookBean;
import cn.zhangmh.easymvp.books.entity.Books;
import io.reactivex.Observable;

/**
 * Created by zmh on 2017/5/1.
 */

public class BooksService {
    
    private  BooksApi booksApi;

    public  BooksService(Context context){

        this.booksApi = RetrofitHelper.getInstance(context).getServer();
    }

    public Observable<Books> getSearchBooks(String name, String tag , int start , int count){
        return  booksApi.getSearchBook(name, tag, start, count);
    }

    public  Observable<BookBean> getBookInfoById(String bookId){
        return  booksApi.getBookInfoById(bookId);
    }

    public  Observable<Annotations> getBooksAnnotations(String bookId){
        return  booksApi.getBooksAnnotations(bookId);
    }


    public  Observable<Annotation> getAnnotation(String annotationId){
        return  booksApi.getAnnotation(annotationId);
    }

    public  Observable<Books> getSeriesBooks(String seriesId){
        return  booksApi.getSeriesBooks(seriesId);
    }
}
